package com.rose.doorto.footbathdoor.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rose.doorto.footbathdoor.dto.QueryDTO;
import com.rose.doorto.footbathdoor.pojo.Teacher;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lqc
 * @since 2024-07-22
 */
public interface TeacherMapper extends BaseMapper<Teacher> {

    /**
     * 技师信息注册
     * @param teacher
     * @return
     */
    int addITeacher(Teacher teacher);

    /**
     * 技师信息修改
     * @param teacher
     * @return
     */
    int updateITeacher(Teacher teacher);

    /**
     * 按照人气值进行排序
     * @return
     */
    List<Teacher> orderByScore();

    /**
     * 安装距离进行排序
     * @return
     */
    List<Teacher> orderByDistance();

    /**
     * 根据项目获取技师列表
     * @param tid
     * @return
     */
    List<Teacher> getTeacherByProjectId(int tid);

    /**
     * 多条件分页查询
     * @return
     */
    IPage<Teacher> selectTeacherPage(Page<Teacher> page, QueryDTO queryDTO);


    Teacher selectById(int tid);
}
